package io.kiki.sba.registry.server.shared.remoting;

import io.kiki.sba.registry.api.Channel;
import io.kiki.sba.registry.common.model.store.Url;

import java.net.InetSocketAddress;


public final class RemotingHelper {

    private RemotingHelper() {
    }

    public static InetSocketAddress getChannelRemoteAddress(Channel channel) {
        return channel == null ? null : channel.getRemoteAddress();
    }

    public static String getRemoteHostAddress(Channel channel) {
        return channel == null ? null : channel.getRemoteAddress().getAddress().getHostAddress();
    }

    public static String getAddressString(Url url) {
        return url == null ? null : url.buildAddressString();
    }


}
